package keeto.com.vn.classified.core;

import java.util.Hashtable;
import java.util.Set;
import java.util.Vector;

import org.json.JSONObject;

import keeto.com.vn.classified.network.IProtocol;
import android.content.Context;

public interface IClassifiedCore {

	IProtocol getProtocol();

	Context getContext();

	String getAuthKey();

	Set<ClassifiedListener> copyAndReconstructListeners(
			ClassifiedListener listener);

	void setAuthKey(String authKey);

	void stopThreads();

	public boolean isNetworkFail();

	void setAckLogon(boolean ackLogon);

	boolean isPersistedAckLogon();

	public void stopCoreAndDestroy();

	public void setCanLogon(boolean canLogon);

	public boolean isCanLogon();

	void setAdditionStatus(Boolean additionStatus);

	Boolean isAdditionStatus();

	boolean isAckLogon();

	int taskLogon(ClassifiedListener listener, String username,
			String password, String present);

	int taskRegister(ClassifiedListener listener, String username,
			String password, String phone);

	boolean filterResponseReturnCode(int returnCode);

	public boolean cleanClassified(boolean builtIn, boolean sync);

	int taskGetAndroidProductAd(ClassifiedListener listener, int pageLimit,String sortBy, int pageNumber, String Area);
	int taskForgotPassWord(ClassifiedListener listener, String email);
	int getUserProfileInfo(ClassifiedListener listener, String authenKey);
	int updateUserProfile(Hashtable<String, String> infos,
			ClassifiedListener listener);
	int taskLogout(ClassifiedListener listener, String authenKey);

//	int taskGetAndroidProductProposed(ClassifiedListener listeners,
//			String guaranteeStoreId, String hightLight, int pageLimit,
//			int pageNumber, String CategoryType, String CategoryID);

	int taskGetProductSubCate(ClassifiedListener listeners, String hightLight,
			String GuaranteeStoreId, int CategoryId, int pageLimnit,
			String categoryType, String itemID, int pageNumber, int SortBy);

//	int taskGetAndroidProductType(ClassifiedListener listeners,
//			String CategoryID, String GuaranteeStoreID, String ItemId,
//			int pageLimit, int pageNumber, String CategoryType, boolean isStore);

//	int taskGetProductBySeller(ClassifiedListener listeners,
//			String CategoryType, String CategoryId, String SellerName,
//			String ItemId, int guaranteeStoreId, int pageNumber, int pageLimit);
	public int taskPublish(JSONObject content, Vector<String> uploadPictures,
			ClassifiedListener listeners,String userName);
	
	int taskGetCommentDetailProduct(ClassifiedListener listeners, String itemId);

	int taskGetAndroidInterest(ClassifiedListener listeners,
			String guaranteStoreId, String userName, String type);

	int taskSendAndroidInterest(ClassifiedListener listeners,
			String guaranteeStoreId, String userName, int isInterest,
			String type, String authenKey);

	int taskComment(ClassifiedListener listeners, String itemId,
			String titleMsg, String message, String userName, int rating,
			String type, boolean isCommented, String timecomment);

	int TaskSendAndroidProductAbusel(ClassifiedListener listeners,
			String ProductID, int UserID, String Message);
	int taskChangePass(ClassifiedListener listener,String oldPass, String newpassword, String authenKey);
	int taskUpdateUserInfo(ClassifiedListener listener,String displayName,String mobile, String email, String area, String gender, String authenKey);

	int taskGetAndroidProductType(ClassifiedListener listeners,
			String CategoryID, String GuaranteeStoreID, String ItemId,
			int pageLimit, int pageNumber, String CategoryType,
			boolean isStore, String NotInPCodes);
	int taskGetAndroidProductSameCost(ClassifiedListener listeners,
			String CategoryID, String GuaranteeStoreID, String ItemId,
			int pageLimit, int pageNumber, String CategoryType,
			boolean isStore, String NotInPCodes,String sameCost);

	int taskGetProductBySeller(ClassifiedListener listeners,
			String CategoryType, String CategoryId, String SellerName,
			String ItemId, int guaranteeStoreId, int pageNumber, int pageLimit,
			String NotInPCodes);
	int taskGetMyHandbook(ClassifiedListener listeners,int type,String userName,int pageNumber, int pageLimit, String AuthKey , String UserId, String hisID);

	int taskGetAndroidProductProposed(ClassifiedListener listeners,
			String AreaIds, String Keywords, String sortBy, int pageLimit,
			int pageNumber, String CategoryType, String CategoryID);

	int taskUpdateViewProduct(ClassifiedListener listener, String PCode);
	
	int taskChangeAvatar(ClassifiedListener listener, byte[] avatarchange, String authkey,String area);
	
	int taskGetSearchGlobal(ClassifiedListener listeners, String AreaIds, int IsDisable, String CategoryType, int pageLimit, int pageNumber, String  Keywords, String CategoryId);

}
